@echo off

rem TIM2 graphic from EV files

if not exist importdec  mkdir  importdec

rem need import to existing EV files to keep dialogs
rem copy if not exist, beware, they will have original english text
FOR %%i IN (0348 0513 0547 0739 0830 1023 1025 1029 1031 1070) DO (
    if exist ..\import\graphic\%%i.bmp  if not exist importdec\%%i.ev  copy   extdec\%%i.ev  importdec\%%i.ev  >NUL
    if exist ..\import\gtim\%%i.tm2     if not exist importdec\%%i.ev  copy   extdec\%%i.ev  importdec\%%i.ev  >NUL
)
rem EV files for duplicities
if not exist importdec\0513.ev  if exist ..\import\graphic\0348.bmp  copy   extdec\0513.ev  importdec\0513.ev  >NUL
if not exist importdec\1023.ev  if exist ..\import\graphic\0739.bmp  copy   extdec\1023.ev  importdec\1023.ev  >NUL
if not exist importdec\1025.ev  if exist ..\import\graphic\0547.bmp  copy   extdec\1025.ev  importdec\1025.ev  >NUL
if not exist importdec\1029.ev  if exist ..\import\graphic\0348.bmp  copy   extdec\1029.ev  importdec\1029.ev  >NUL
if not exist importdec\1031.ev  if exist ..\import\graphic\0348.bmp  copy   extdec\1031.ev  importdec\1031.ev  >NUL
if not exist importdec\1070.ev  if exist ..\import\graphic\0739.bmp  copy   extdec\1070.ev  importdec\1070.ev  >NUL
rem EV files for duplicities (tim2)
if not exist importdec\0513.ev  if exist ..\import\gtim\0348.tm2     copy   extdec\0513.ev  importdec\0513.ev  >NUL
if not exist importdec\1023.ev  if exist ..\import\gtim\0739.tm2     copy   extdec\1023.ev  importdec\1023.ev  >NUL
if not exist importdec\1025.ev  if exist ..\import\gtim\0547.tm2     copy   extdec\1025.ev  importdec\1025.ev  >NUL
if not exist importdec\1029.ev  if exist ..\import\gtim\0348.tm2     copy   extdec\1029.ev  importdec\1029.ev  >NUL
if not exist importdec\1031.ev  if exist ..\import\gtim\0348.tm2     copy   extdec\1031.ev  importdec\1031.ev  >NUL
if not exist importdec\1070.ev  if exist ..\import\gtim\0739.tm2     copy   extdec\1070.ev  importdec\1070.ev  >NUL


rem import BMP
if exist ..\import\graphic\0348.bmp   ffxgnop  -i 0x4719A0    importdec\0348.ev  ..\import\graphic\0348.bmp
if exist ..\import\graphic\0547.bmp   ffxgnop  -i 0x5A20      importdec\0547.ev  ..\import\graphic\0547.bmp
if exist ..\import\graphic\0739.bmp   ffxgnop  -i 0xD5EA0     importdec\0739.ev  ..\import\graphic\0739.bmp
if exist ..\import\graphic\0830.bmp   ffxgnop  -i 0x107A0     importdec\0830.ev  ..\import\graphic\0830.bmp
rem possible duples
if exist ..\import\graphic\0513.bmp   ffxgnop  -i 0x6F80      importdec\0513.ev  ..\import\graphic\0513.bmp
if exist ..\import\graphic\1023.bmp   ffxgnop  -i 0x1C940     importdec\1023.ev  ..\import\graphic\1023.bmp
if exist ..\import\graphic\1025.bmp   ffxgnop  -i 0x3660      importdec\1025.ev  ..\import\graphic\1025.bmp
if exist ..\import\graphic\1029.bmp   ffxgnop  -i 0x80140     importdec\1029.ev  ..\import\graphic\1029.bmp
if exist ..\import\graphic\1031.bmp   ffxgnop  -i 0x9C1A0     importdec\1031.ev  ..\import\graphic\1031.bmp
if exist ..\import\graphic\1070.bmp   ffxgnop  -i 0xABA0      importdec\1070.ev  ..\import\graphic\1070.bmp
rem duplicities
if not exist ..\import\graphic\0513.bmp  if exist ..\import\graphic\0348.bmp  ffxgnop  -i 0x6F80   importdec\0513.ev  ..\import\graphic\0348.bmp
if not exist ..\import\graphic\1023.bmp  if exist ..\import\graphic\0739.bmp  ffxgnop  -i 0x1C940  importdec\1023.ev  ..\import\graphic\0739.bmp
if not exist ..\import\graphic\1025.bmp  if exist ..\import\graphic\0547.bmp  ffxgnop  -i 0x3660   importdec\1025.ev  ..\import\graphic\0547.bmp
if not exist ..\import\graphic\1029.bmp  if exist ..\import\graphic\0348.bmp  ffxgnop  -i 0x80140  importdec\1029.ev  ..\import\graphic\0348.bmp
if not exist ..\import\graphic\1031.bmp  if exist ..\import\graphic\0348.bmp  ffxgnop  -i 0x9C1A0  importdec\1031.ev  ..\import\graphic\0348.bmp
if not exist ..\import\graphic\1070.bmp  if exist ..\import\graphic\0739.bmp  ffxgnop  -i 0xABA0   importdec\1070.ev  ..\import\graphic\0739.bmp


rem import tim2 (overwrite BMPs inserts if exist)
if exist ..\import\gtim\0348.tm2  fcopy  -IM  importdec\0348.ev  ..\import\gtim\0348.tm2  4659552   33856
if exist ..\import\gtim\0513.tm2  fcopy  -IM  importdec\0513.ev  ..\import\gtim\0513.tm2  28480     33856
if exist ..\import\gtim\0547.tm2  fcopy  -IM  importdec\0547.ev  ..\import\gtim\0547.tm2  23008     66624
if exist ..\import\gtim\0739.tm2  fcopy  -IM  importdec\0739.ev  ..\import\gtim\0739.tm2  876128    33856
if exist ..\import\gtim\0830.tm2  fcopy  -IM  importdec\0830.ev  ..\import\gtim\0830.tm2  67424     33856
if exist ..\import\gtim\1023.tm2  fcopy  -IM  importdec\1023.ev  ..\import\gtim\1023.tm2  116992    33856
if exist ..\import\gtim\1025.tm2  fcopy  -IM  importdec\1025.ev  ..\import\gtim\1025.tm2  13856     66624
if exist ..\import\gtim\1029.tm2  fcopy  -IM  importdec\1029.ev  ..\import\gtim\1029.tm2  524544    33856
if exist ..\import\gtim\1031.tm2  fcopy  -IM  importdec\1031.ev  ..\import\gtim\1031.tm2  639328    33856
if exist ..\import\gtim\1070.tm2  fcopy  -IM  importdec\1070.ev  ..\import\gtim\1070.tm2  43872     33856

rem import tim2 duplicites if not imported above
if not exist ..\import\gtim\0513.tm2  if exist ..\import\gtim\0348.tm2  fcopy  -IM  importdec\0513.ev  ..\import\gtim\0348.tm2  28480     33856
if not exist ..\import\gtim\1023.tm2  if exist ..\import\gtim\0739.tm2  fcopy  -IM  importdec\1023.ev  ..\import\gtim\0739.tm2  116992    33856
if not exist ..\import\gtim\1025.tm2  if exist ..\import\gtim\0547.tm2  fcopy  -IM  importdec\1025.ev  ..\import\gtim\0547.tm2  13856     66624
if not exist ..\import\gtim\1029.tm2  if exist ..\import\gtim\0348.tm2  fcopy  -IM  importdec\1029.ev  ..\import\gtim\0348.tm2  524544    33856
if not exist ..\import\gtim\1031.tm2  if exist ..\import\gtim\0348.tm2  fcopy  -IM  importdec\1031.ev  ..\import\gtim\0348.tm2  639328    33856
if not exist ..\import\gtim\1070.tm2  if exist ..\import\gtim\0739.tm2  fcopy  -IM  importdec\1070.ev  ..\import\gtim\0739.tm2  43872     33856

